<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%
  String QuanID=request.getParameter("QuanID");
  
%>
<script>

function getJsonMessage(quanId){
	 $.ajax({
			url: '/sapfree/servlet/MessageBoradServlet?method=ajaxGetMessageByQuanId&QuanId='+quanId, 
			dataType: 'text',
			type: "post",
			error:function(XMLHttpRequest,textStatus,errorThrown){alert(errorThrown);},
			success: function(data) {
			     initTable(data);
			     $("#wait").hide();
			}
		});
}

function initTable(data){
   $('.message').remove();
	data=eval(data);
	 var s="";
      for(i=0;i<data.length;i++){
          s+=initTr(data[i]);
      }   
      $("#messageBorad").append(s);  
}

function initTr(message){
    var s="";
    s+="<tr class='message'> <td width=\"10\" align=\"right\"></td>";
    s+="<td height=\"30\" colspan=\"2\" align=\"left\" class=\"blackNormal12\">";
    s+="<a href=\"../personPage/personHome.html\" target=\"_blank\"><span class=\"lightBlueNormal12\">";
    s+="【"+message.cc_perosnname+"】</span></a> ";
    s+=message.cc_commentcontent+"<span class=\"greyNormal12\">&nbsp;&nbsp;（";
    s+=message.cc_commenttime+"）</span></td></tr>";
    return s;
}
</script>
 

      <table id="messageBorad" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
          <tr>
            <td width="10" align="right" height="30"></td>
            <td width="580" class="blueBold14 tableHeadTitle" width="340">&nbsp;&nbsp;<img src="../images/medal_gold.png" align="absmiddle">&nbsp;留言板</td>
            <td colspan="2" align="right" height="35" class="lightBlueBold12 tableHeadTitle">更多留言&nbsp;&nbsp;</td>
            <td width="10" align="right" height="35"></td>
          </tr>
          
          <tr><td height="10"></td></tr>
         
          <tr id="wait"> <td width="10" align="right"></td>
             <td height="30" style="font-size:12px" align=center><img src="../include/images/loading.gif" /> 加载……</td>
             <td width="10" align="right"></td>
          </tr>
          
 </table>

 <script>
 getJsonMessage('<%=QuanID%>');
 </script>